#ifndef _LIST_H
#define _LIST_H

#include <xlibrary.h>

// common headers
#include "common.h"		// global

// local headers
#include "library.h"	// internal

typedef struct sINIList sINIList;
struct sINIList {
	struct sINIList *prev;
	struct sINIList *next;

	char *section;
	char *param;
	u32 hash;

	char *value;
};

typedef struct {
	sINIList *first;
	sINIList *next;
} sINI;

typedef void (*il_remove_handler)(char *section, char *param, char *value);

int		il_add			(sINI *ini, char *section, char *param, char *value);
int		il_get			(sINI *ini, char *section, char *param, char **value);
int		il_getFirst		(sINI *ini, char **section, char **param, char **value);
int		il_getNext		(sINI *ini, char **section, char **param, char **value);
void	il_removeFree_h	(char *section, char *param, char *value);	// can be used by il_removeAll
int		il_removeAll	(sINI *ini, il_remove_handler handler);	// NULL in the second arg to do nothing

#endif
